package com.fishingwithme.infrastructure.dtos;

import com.fishingwithme.domain.spots.FishType;
import com.fishingwithme.infrastructure.utils.CommonUtils;
import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.Data;
import org.json.JSONException;

@Data
public class HarvestFishDto {
    private FishType type;
    private Integer count;
    public ObjectNode toJson() throws JSONException {
        ObjectNode json = CommonUtils.objectMapper.createObjectNode();
        json.putIfAbsent("type",this.type.toJson());
        json.put("count", this.count);
        return json;
    }
}
